<%@ page language="java" pageEncoding="UTF-8"%><!DOCTYPE html>
<html><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
	<head>
		<title>${type.articleTypeName }</title>
		<jsp:include page="/head.jsp"/>
    <link rel="stylesheet" type="text/css" href="assets/css/article.css" />
	</head>
	<body>
    <header style="z-index: 999;">
      <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <a class="navbar-brand" href="./">某某某网</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#systemMenu" aria-controls="navbarColor01"
          aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="systemMenu">
          <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
              <a class="nav-link" href="#">网站首页
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">文章类别</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">文章类别</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#">文章类别</a>
            </li>
          </ul>
        </div>
      </nav>
    </header>
    <div>
      <section>
        <nav aria-label="breadcrumb">
          <ol class="breadcrumb">
            <li class="breadcrumb-item" aria-current="page"><a href="/">网站首页</a></li>
            <li class="breadcrumb-item" aria-current="page">新闻中心</li>
            <li class="breadcrumb-item" aria-current="page">${type.articleTypeName }</li>
          </ol>
        </nav>
        <div class="news-list">
        <c:forEach items="${p.records }" var="vo">
          <a href="#" title="${vo.articleTitle }">
            <div class="row">
              <div class="col-sm-3">
                <img class="img-thumbnail w-100" onerror="this.src='assets/img/no-img.png'" src="${t.toList(vo.articleImgs)[0] }"
                  alt="${vo.articleTitle }">
              </div>
              <div class="col-sm-9">
                <h1>${vo.articleTitle }</h1>
                <div class="news-about">${t.subStr(vo.articleContent,80,true) }</div>
                <div class="news-time">
                  <i class="fa fa-calendar mr-1"></i>${t.formatDate(vo.articleTime,"yyyy年MM月dd日HH时mm分") }
                  <i class="fa fa-pencil-square-o ml-3 mr-1"></i>${vo.articleWorker }</div>
              </div>
            </div>
          </a>
		</c:forEach>
        </div>

		<div class="mt-2">${t.page(p,5) }</div>
        <script type="text/javascript">
        var pageLinks = document.querySelector(".pagination").querySelectorAll("[data-page]");
        pageLinks.forEach((item)=>{
          item.onclick=()=>{
            let url = new URL(location.href);
            url.searchParams.set("current",item.dataset.page);
            location=url.toString();
          }
        });
			  
        </script>
      </section>
      <aside>
        <form action="article/page.do" style="background-color: #FFF; padding-bottom: .2rem; margin: 0;">
          <input name="articleTypeId" value="${param.articleTypeId}" type="hidden"/>
          <input name="size" value="${param.size}" type="hidden"/>
          <div class="form-group">
            <div class="input-group">
              
              <input name="key" class="form-control" type="text" placeholder="标题" value="${param.key}">
              <div class="input-group-append"><button class="btn btn-secondary my-2 my-sm-0" type="submit"><i class="fa fa-search"></i></button>
              </div>
            </div>
          </div>
        </form>
      </aside>
    </div>
    <footer></footer>
	</body>
</html>
